package com.xiaoze.steampy.controller;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.xiaoze.steampy.common.dto.MessList;
import com.xiaoze.steampy.common.lang.Result;
import com.xiaoze.steampy.entity.UserGame;
import com.xiaoze.steampy.service.UserGameService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 小泽
 * @since 2022-04-01
 */
@RestController
@RequestMapping
public class UserGameController {

    @Autowired
    UserGameService userGameService;
     /*
     根据用户游戏id查询所有得game
    * */
    @RequestMapping("/getListMess")
    public Result getAll(@RequestParam("id") Integer id){
        List<MessList> allmess = userGameService.getAllmess(id);
        Map<String, List<MessList>> map = new HashMap<>();
        map.put("list",allmess);
        return Result.succ(map);
    }
}
